package com.soft.entity;


import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

//订单实体类
public class Order {

    private int id;//订单编号
    private String buyer;//下单人
    private String receiver;//收货人
    private int typeNumber;//品种数
    private int payMethod;//付款方式
    private int deliveryMethod;//货运方式
    private Date time;//下单日期
    private int status;//订单状态
    private String closeDetail;//关闭备注
    private String detail;//备注

    public Order(){}

    public void setId(String id) {
        this.id = Integer.parseInt(id);
    }

    public int getId() {
        return id;
    }

    public void setBuyer(String buyer) {
        this.buyer = buyer;
    }

    public String getBuyer() {
        return buyer;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setTypeNumber(String typeNumber) {
        this.typeNumber = Integer.parseInt(typeNumber);
    }

    public int getTypeNumber() {
        return typeNumber;
    }

    public void setPayMethod(String payMethod) {
        this.payMethod = Integer.parseInt(payMethod);
    }

    public int getPayMethod() {
        return payMethod;
    }

    public void setDeliveryMethod(String deliveryMethod) {
        this.deliveryMethod = Integer.parseInt(deliveryMethod);
    }

    public int getDeliveryMethod() {
        return deliveryMethod;
    }

    public void setStatus(String status) {
        this.status = Integer.parseInt(status);
    }

    public int getStatus() {
        return status;
    }

    public void setCloseDetail(String closeDetail) {
        this.closeDetail = closeDetail;
    }

    public String getCloseDetail() {
        return closeDetail;
    }

    public void setTime(String time) throws ParseException {
        this.time = new SimpleDateFormat("yyyy-MM-dd").parse(time);
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public String getDetail() {
        return detail;
    }

    public Date getTime() {
        return time;
    }

    public static final class PAYMETHOD {
        public static final int PAYMETHOD_WECHAT = 0;//微信支付
        public static final int PAYMETHOD_ALIPAY = 1;//支付宝支付
        public static final int PAYMETHOD_CFP = 2;//云闪付支付
    }

    public static final class DELIVERYMETHOD {
        public static final int DELIVERYMETHOD_YT = 0;//圆通
        public static final int DELIVERYMETHOD_SF = 1;//顺风
        public static final int DELIVERYMETHOD_BS = 2;//百世
    }

    public static final class STATUS {
        public static final int STATUS_CREATED = 0;//已下单
        public static final int STATUS_PAYED = 1;//已支付
        public static final int STATUS_DELIVERED = 2;//已发货
        public static final int STATUS_CLOSED = 3;//已关闭
    }
}
